<template>
    <div>
    <h1>校园选宿舍系统</h1>
    <h2>下一轮选宿舍开始时间：{{ start_time }}</h2>
    <h2>下一轮选宿舍结束时间：{{ end_time }}</h2>
    <h2>当前状态：{{status}}</h2>
    <LogOut></LogOut>

<router-view></router-view>
    </div>
</template>
<script>
// import  CountDown from '@/components/CountDown.vue'
import {getLastEvent} from '@/api/event'
import LogOut from '@/components/LogOut.vue'
export default{
    components: {
    // CountDown
    LogOut

    },
    data(){
        return {
            start_time: "",
            end_time: "",
            status:""
        }
    },
    mounted(){
        getLastEvent().then(res=>{
            this.start_time=this.$moment(res.data.startTime).format('MMM Do h:mm:ss');
            this.end_time=this.$moment(res.data.endTime).format('MMM Do h:mm:ss');
            this.status=res.data.status
        }
        )
    }
}
</script>
